//
//  PillowTimeSetCell.m
//  Lightthings
//
//  Created by 王岩 on 2025/1/16.
//

#import "PillowTimeSetCell.h"

#import "PillowTimeSetModel.h"
@implementation PillowTimeSetCell

- (void)setModel:(PillowTimeSetModel  *)model {
    [super setModel:model];
    
    self.startTimeLab.text = model.start;
    self.endTimeLab.text = model.end;
    
}


- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.layer.cornerRadius = 10;
    self.layer.masksToBounds =  YES;
    
    self.startTimeLab.layer.cornerRadius = 8;
    self.startTimeLab.layer.masksToBounds =  YES;
      
    self.endTimeLab.layer.cornerRadius = 8;
    self.endTimeLab.layer.masksToBounds =  YES;
    
    self.startTimeLab.zh_action = kMsgForward(@"startAction", WKProxy(self));
    self.endTimeLab.zh_action = kMsgForward(@"endAction", WKProxy(self));
    
    // Initialization code
}

- (void)startAction {
    [BRDatePickerView showDatePickerWithMode:BRDatePickerModeHM title:nil selectValue:nil resultBlock:^(NSDate * _Nullable selectDate, NSString * _Nullable selectValue) {
        self.startTimeLab.text = selectValue;
    }];
}
- (void)endAction {
    [BRDatePickerView showDatePickerWithMode:BRDatePickerModeHM title:nil selectValue:nil resultBlock:^(NSDate * _Nullable selectDate, NSString * _Nullable selectValue) {
        self.endTimeLab.text = selectValue;
    }];
}


@end
